package com.stt.builder.impl;

import com.stt.builder.CharacterBuilder;
import com.stt.model.Character;
import org.springframework.stereotype.Component;

/**
 * 战士角色建造者
 */
@Component
public class WarriorBuilder implements CharacterBuilder {
    private Character character;
    
    public WarriorBuilder() {
        character = new Character();
        character.setProfession("Warrior");
        character.setLevel(1);
    }
    
    @Override
    public CharacterBuilder setBasicInfo(String name) {
        character.setName(name);
        return this;
    }
    
    @Override
    public CharacterBuilder setAttack(Integer attack) {
        // 战士攻击力加成20%
        character.setAttack((int)(attack * 1.2));
        return this;
    }
    
    @Override
    public CharacterBuilder setHealth(Integer health) {
        // 战士生命值加成50%
        character.setHealth((int)(health * 1.5));
        return this;
    }
    
    @Override
    public CharacterBuilder setMana(Integer mana) {
        // 战士魔法值较低
        character.setMana((int)(mana * 0.5));
        return this;
    }
    
    @Override
    public Character build() {
        return character;
    }
} 